package com.atguigu.gulimall.coupon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;

/**
 * 如何使用nacos作为配置中心统一管理配置
 * 1.引入依赖
 *
*          <dependency>
*             <groupId>com.alibaba.cloud</groupId>
*             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
*         </dependency>
 * 2.创建boostrap.properties
 * spring.application.name=gulimall-coupon
 * spring.cloud.nacos.config.server-addr=127.0.0.1:8848
 *
 * 3.在配置中心中需要添加一个数据集  (Data id) gulimall-coupon.properties 命名规则 应用名.properties
 * 在配置文件中添加任何配置
 *
 * 4.动态获取配置
 * @Value  @RefreshScope
 */
@SpringBootApplication
@EnableDiscoveryClient
@RefreshScope
public class GulimallCouponApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallCouponApplication.class, args);
    }

}
